import request from '@/utils/request'

// 获取文件列表
export function listPath(filePath) {
    return request({
        url: '/business/dcc/list',
        method: 'get',
        params: {"filePath": filePath}
    })
}
// 获取一级文件夹列表
export function listDirectory() {
    return request({
        url: '/business/dcc/listDirectory/dcc',
        method: 'get'
    })
}
// 获取所有文件
export function listAllByDirectory(dirId) {
    return request({
        url: '/business/dcc/listAllByDirectory/dcc',
        method: 'get',
        params: {"dirId": dirId}
    })
}
// 生成树形选择框
export function getAssignSource(id) {
    return request({
        url: '/business/dcc/getAssignSource/'+id,
        method: 'get'
    })
}
// 发送邮件
export function assignEmail(body) {
    return request({
        url: '/business/dcc/assignEmail',
        method: 'post',
        data:body
    })
}
// 获取配置文件列表
export function getFilesConfig() {
    return request({
        url: '/business/dcc/getFilesConfig',
        method: 'get',
        params: {}
    })
}
// 同步文件
export function syncFiles() {
    return request({
        url: '/business/dcc/syncFiles',
        method: 'get',
        params: {}
    })
}
// 增加文件夹配置
export function addFilesConfig(fileDirName) {
    return request({
        url: '/business/dcc/addFilesConfig',
        method: 'get',
        params: {"fileDirName":fileDirName}
    })
}
// 删除文件夹配置
export function deleteFilesConfig(menuId) {
    return request({
        url: '/business/dcc/deleteFilesConfig',
        method: 'get',
        params: {"menuId":menuId}
    })
}
// 修改是否可见
export function editVisible(fileid,visible) {
    return request({
        url: '/business/dcc/editVisible/'+fileid+'/'+visible,
        method: 'get'
    })
}
